package com.wzcl.app.controller;

import com.wzcl.app.dao.model.RechargePriceList;
import com.wzcl.app.model.common.RVO;
import com.wzcl.app.service.RechargePriceListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * @author beingven
 * @Description TODO
 * @createTime 2020年11月21日 15:49:00
 */
@RestController
@RequestMapping("/recharge")
@Api(value = "IOS价格管理controller", tags = {"IOS价格管理相关接口"})
public class RechargePriceListController {
    @Resource
    private RechargePriceListService rechargePriceListService;

    @ApiOperation("插入价目表信息")
    @PostMapping("/insert")
    public RVO insert(@RequestBody RechargePriceList rechargePriceList) {
        return rechargePriceListService.insert(rechargePriceList);
    }

    @ApiOperation("删除价目表信息")
    @GetMapping("/delete")
    public RVO deleteById(@RequestParam Integer id) {
        return rechargePriceListService.deleteById(id);
    }

    @ApiOperation("查询价目表信息")
    @GetMapping("/search")
    public RVO findAllDesc() {
        return rechargePriceListService.findAllDesc();
    }

    @ApiOperation("更新价目表信息")
    @PutMapping("/update")
    public RVO updateById(@RequestBody RechargePriceList rechargePriceList) {
        return rechargePriceListService.updateById(rechargePriceList);
    }
}
